Patrick Steele's .NET Blog
Implements ICodeWithDotNet
-
Why you need to learn async in .NET
I had an opportunity to teach a quick class yesterday about what’s new in .NET 4.0. One of the topics was the TPL (Task Parallel Library) and how it can make async programming easier. I also stressed that this is the direction Microsoft is going with for C# 5.0 and learning the TPL will greatly benefit their understanding of the new async stuff. We had a little time left over and I was able to show some code that uses the Async CTP to accomplish some stuff, but it wasn’t a simple demo that you could jump in to and understand so I thought I’d thrown one together and put it in a blog post.
-
Using hg bisect to hunt down bugs
The “bisect” command in Mercurial (git has it too) is a great way to quickly find which version of your code introduced a bug. This post will show you how to use the bisect command along with handling a small “gotcha” I encountered while using it.
-
2012 Begins
It has become tradition for the past few years that my first blog post of the new year is to thank Microsoft for being recognized as an MVP. This year is no different. Once again, I’m honored to be recognized by Microsoft for my contributions to the community. After visiting Redmond for the past 4 years, I’m going to be skipping the Summit this year. I’ve got a client project that I really want to focus on and don’t want to push it out another week.
-
Using WPF Converters to Affect Multiple Properties
I’m working on my first WPF application. I’ve done a ton of reading on WPF and it’s helped me in my understandings of how WPF works. So far, I’m really liking the data binding flexibility WPF gives you. That, along with a very testable MVVM-based architecture, has made the experience a fun one!
-
Published My First Android Application!
While I’ve been playing around with Android development for a few months and I’ve started half-a-dozen various apps, I finally completed one and submitted it to the Android Market. It’s a simple SQLite database app that contains the 2011 ferry schedule for the Star Line Mackinac Island Ferry.
-
Taking Android Emulator Screenshots WITHOUT Eclipse.
I’m working on an Android app and before publishing it to the Android Market, I needed some screenshots. I assumed the emulator supported screenshots, but when I did a search for “android emulator screenshot”, most of the hits talked about how to do it from Eclipse. I’m using IntelliJ IDEA Community Edition. However, based on the descriptions, I understood what was going on.
-
HOWTO: Change which “.testsettings” file Visual Stuido 2010 uses
I’m blogging this mainly for historical reasons. I just spent over 30 minutes trying to figure this out. Well, the first 10 or 15 minutes was getting code coverage enabled in Visual Studio 2010. There’s plenty of coverage on that topic since it’s not as intuitive as it could be. I’ll let Google handle that one.
-
WPF: Simple “Busy” Overlay
I’m working on a WPF project that does some background processing which could take more than a few seconds. Instead of a busy cursor, I want to give the user a simple “Please wait…” message via an overlay that appears on top of the form. I found the solution in this stackoverflow question. However, the solution presented there was an overview. In this post I’ll show a complete example along with a downloadable sample project so you can play with it for yourself.
-
Clarification on Updating DefaultLocation in an MSI
Back in February, I did a blog post on how to change the default location for an Application installed via an MSI. Thanks to a comment from Joe Marcelino, it wasn’t clear where to find the “DefaultLocation” field to change that. Here’s a quick how-to on finding the field.
-
Android: Encapsulating Shared Preferences
The Android OS gives you a convenient way to save and load simple data (i.e. string, float, int, boolean and long) in the form of SharedPreferences. The data is stored in a dictionary format that utilizes a key/value pair. The “name” of the preferences is also supplied by your code. In a lot of the samples you’ll find online, the name of the shared preferences and all of the keys are stored as constants at the top of the Activity class (or worse, the key names are copy/pasted throughout the code!). I don’t like polluting my Activity classes with stuff like that so I’ve been encapsulating my preferences in their own class.